<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

//WCX
/*登录路由*/
Route::group(['prefix'=>"admin",'namespace'=>"Admin"],function(){
    Route::any('login',"LoginController@index");//登录
    Route::get('code',"LoginController@code");//生成验证码
    Route::get('getcode',"LoginController@getCode");//查看验证码的值
    Route::get('outlog',"loginController@outlog");//退出
});


//,'middleware'=>["admin.login"]


//后台页面
Route::group(['prefix' => 'admin','namespace' => 'Admin','middleware'=>["admin.login"]], function () {
//路由前缀；命名路由（公共命名空间）；中间件（session状态；自定义登陆）；
//基本路由

    //WCX
    Route::get('/',"IndexController@index");//首页路由
    Route::any('password',"IndexController@password");//修改密码路由
    Route::resource('package','PackageController');//套餐资源路由
    Route::resource('action',"ActionController");//活动资源路由
    Route::get('index', 'IndexController@index');//后台主页
    Route::get('welcome', 'IndexController@welcome');//后台欢迎页面


    //pb
    Route::resource('car','CarController');//创建汽车表的资源路由
    Route::any('car/upload','CarController@upload');//异步上传图片




    //LXY
    //后台主页
    Route::get('index', 'IndexController@index');
    //后台欢迎页面
    Route::get('welcome', 'IndexController@welcome');

    //后台车型资源路由
    Route::resource('carModel', 'CarModelController');
    //后台品牌资源路由
    Route::resource('brand', 'BrandController');

    //上传图片
    Route::any('upload', 'CommonController@upload');

    //品牌车系 子集添加
    Route::get('brand/create/{bid}', 'BrandController@create');

    //CTQ
    //后台城市——cc
    Route::resource('city','CityController');
//    Route::get('city','CityController@index');门店——cc
    Route::resource('store','StoreController');
});